package com.company;

import java.util.Arrays;

public class Yuekao2 {
    public static void main(String[] args) {
        int[] a = {30, 1, -9, 70, 25, 87};
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = 0; j < a.length - 1 - i; j++) {
                if (a[j] > a[j + 1]) {
                    int temp = a[j + 1];
                    a[j + 1] = a[j];
                    a[j] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(a));
        //2.	对数组a[]={30,1,-9,70,25，87}进行由小到大的排序，并输出最终结果。
    }
}
